package com.iwdnb.gkgz.ui.controller;

import java.util.Date;
import java.util.List;
import java.util.concurrent.Executor;

import cn.hutool.core.date.DateUtil;
import com.google.common.collect.Lists;
import com.iwdnb.bmnf.common.model.result.Result;
import com.iwdnb.bmnf.common.service.CacheService;
import com.iwdnb.gkgz.application.model.vo.StockType;
import com.iwdnb.gkgz.application.service.HistoryDataService;
import com.iwdnb.gkgz.application.service.RealtimeStockService;
import com.iwdnb.gkgz.application.service.StockDayDataSerivce;
import com.iwdnb.gkgz.application.service.StockEmotionService;
import com.iwdnb.gkgz.application.service.StockService;
import com.iwdnb.gkgz.common.model.dto.StockDayData;
import com.iwdnb.gkgz.common.model.dto.StockEmotion;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 股票交易情绪处理
 *
 * @author wbc
 * @date 2024/11/28
 **/
@RestController
@RequestMapping("/api/stock/emotion")
@Slf4j
public class StockEmotionController {

    @Autowired
    private StockEmotionService stockEmotionService;

    @RequestMapping("/initEmotions")
    public Result<String> initEmotions(String begin, String end, String loadDataFlag) {
        stockEmotionService.initEmotions(begin, end, loadDataFlag);
        return Result.getSuccessResult(null);
    }

    @RequestMapping("/getPredicateStockEmotion")
    public Result<StockEmotion> getPredicateStockEmotion(String date) {
        return Result.getSuccessResult(stockEmotionService.getPredicateStockEmotion(date));
    }


    @RequestMapping("/getFenshiStockEmotion")
    public Result<StockEmotion> getFenshiStockEmotion(String date) {
        return Result.getSuccessResult(stockEmotionService.getFenshiStockEmotion(date));
    }
}
